package t;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.Collections;

import cn.xyt.util.ByteUtil;

public class FileT {
	
	static void aa(){
		String str ="41 54 2B 51 49 53 45 4E 44 3D 34 34 0D 0A 41 54 2B 51 49 43 4C 4F 53 45 0D 0A 41 54 2B 51 49 53 54 41 54 0D 0A 41 54 2B 43 47 52 45";
		System.out.println(new String(ByteUtil.hexStrtoByte(str)));
		
	}

	public static void main(String[] args) {
		aa();
		String v = "1.1.2.015".substring(0, 5);
		System.out.println(v);

		String uppath = "d:";
		String vpath = uppath + "/" + v;

		File f = new File(vpath);
		File ff[] = f.listFiles();
		File max = getMax(ff);
		System.out.println(max.getName());
	}

	public static File getMax(File[] files) {
		File f = null;
		for (int i = 0; i < files.length; i++) {
			File _f = files[i];
			if (i == 0)	f = _f;
			if (f.getName().compareTo(_f.getName()) < 0) {
				f = _f;
			}
		}
		return f;
	}
	

}
